<template>
	<view class="item" v-for="(item, index) in state.discounts" :key="index">
		<view class="box">
			<view class="content">
				<view class="page-group">
					<view class="fold-page"></view>
					<span class="page">折扣券</span>
				</view>
				<view class="inner-content">
					<view class="money">￥{{item.money / 100}}</view>
					<view class="sale">已售{{item.sale}}张</view>
				</view>
				<view class="dot-left"></view>
				<view class="dot-right"></view>
			</view>
			<view class="footer">
				<view class="footer-label">使用说明</view>
				<view>
					到店消费
					<view class="discount">{{item.discount}}</view>
					折
				</view>
			</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
import {state} from '../store/business'
	
</script>

<style scoped lang="scss">
.item {
	width: calc(50% - 10px);
	overflow: hidden;
	margin-bottom: 10px;
	padding-left: 2px;
	position: relative;
}
.box {
	background: #fff;
	border-radius: 5px;
	background: linear-gradient(45deg, orange, red);
}
.item .dot-left,
.item .dot-right {
	display: block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #f5f5f5;
	position: absolute;
	z-index: 999;
}
.item .dot-left {
	bottom: -6px;
	left: -6px;
}
.item .dot-right {
	bottom: -6px;
	right: -6px;
}
.item .page-group {
	position: absolute;
	top: 10px;
	left: -2px;
	width: 100%;
	max-width: 120px;
}
.item .page-group .fold-page {
	display: block;
	width: 2px;
	height: 5px;
	background: #db0113;
	transform: skewY(-40deg);
	position: absolute;
	top: -1px;
	left: 0;
	z-index: 0;
}
.item .page-group .page {
	position: absolute;
	z-index: 1;
	display: block;
	padding: 0 10px;
	height: 20px;
	background: linear-gradient(137deg, #ff5b5b 0%, #db0113 100%);
	border-radius: 0 20px 20px 0;
	color: #fff;
	text-align: center;
	font-size: 12px;
	overflow: hidden;
}
.item .content {
	width: 100%;
	height: 90px;
	border-bottom: 1px dotted #f5f5f5;
	position: relative;
	z-index: 2;
}
.item .footer {
	color: #fff;
	font-size: 12px;
	padding: 5px 15px 10px 15px;
}
.footer-label {
	line-height: 24px;
}
.item .ribbon {
	width: 80px;
	height: 20px;
	background: #dd0d1f;
	position: absolute;
	right: -20px;
	top: 10px;
	transform: rotateZ(45deg);
	text-align: center;
	color: #fff;
	font-size: 12px;
}

.inner-content {
	padding-top: 25px;
	color: white;
	text-align: center;
	.money {
		font-size: 28px;
	}
}
.discount{
	font-size: 18px;
	display: inline;
}
</style>
